import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
import path from 'path'
// https://vite.dev/config/
export default defineConfig({
	plugins: [react()],
	// 配置服务代理
	server: {
		host: 'localhost',
		port: 8080,
		proxy: {
			'/api': 'http://api-driver.marsview.cc'
		}
	},
	resolve: {
		// 添加路径别名
		alias: {
			'@': path.resolve(__dirname, './src')
		}
	},
	// 新增 css 配置
	css: {
		// postcss: {
		// 	plugins: [tailwindcss()],
		// },
		preprocessorOptions: {
			scss: {
				// 两种方式都可以
				additionalData: `@use "@/assets/styles/variables.scss" as *;`
			}
		}
	}

})
